package myJs.common

import com.softwaremill.quicklens._
import myJs.Implicits._
import myJs.common.loadSample.LoadSample
import myJs.cps.{PureDateTimePickerCp, PureSelectCp, Style}
import myJs.myPkg.reactHookForm.{RegisterOptions, UseFormRT, ValidationValueMessage}
import myJs.tool.Tool
import shared.pojo.Sample.{CommentData, SampleInfo}
import slinky.core.FunctionalComponent
import slinky.core.annotations.react
import slinky.core.facade.Fragment
import slinky.core.facade.Hooks.useEffect
import slinky.web.html._

import scala.scalajs.js.Date

/**
 * Created by yz on 21/1/2022
 */
@react object LabViewCp {


  case class Props(
                    sampleInfo: SampleInfo,
                    show: Boolean = true,
                  )

  val component = FunctionalComponent[Props] { props =>

    object FTool {
    }

    Fragment(

      h4("实验信息"),

      div(className := "form-group",
        label(className := "control-label col-sm-2", "出库时间:"),
        div(className := "col-sm-4",
          p(className := "form-control-static", s"${props.sampleInfo.lab.exWareHouseTime}")
        ),
        label(className := "control-label col-sm-2", "入库时间:"),
        div(className := "col-sm-4",
          p(className := "form-control-static", s"${props.sampleInfo.lab.wareHouseTime}")
        )
      ),

      div(className := "form-group",
        label(className := "control-label col-sm-2", "样本增耗量:"),
        div(className := "col-sm-4",
          p(className := "form-control-static", s"${props.sampleInfo.lab.amount}")
        ),
        label(className := "control-label col-sm-2", "样本组成:"),
        div(className := "col-sm-4",
          p(className := "form-control-static", s"${props.sampleInfo.lab.compose}")
        )
      ),

      div(className := "form-group",
        label(className := "control-label col-sm-2", "实验人员:"),
        div(className := "col-sm-4",
          p(className := "form-control-static", s"${props.sampleInfo.lab.tester}")
        ),
        label(className := "control-label col-sm-2", "性别鉴定:"),
        div(className := "col-sm-4",
          p(className := "form-control-static", s"${props.sampleInfo.lab.sex}")
        )
      ),

      div(className := "form-group",
        label(className := "control-label col-sm-2", "咬节长度:"),
        div(className := "col-sm-4",
          p(className := "form-control-static", s"${props.sampleInfo.lab.bambooLength}")
        ),
      ),

      div(className := "form-group",
        label(className := "control-label col-sm-2", "附件:"),
        div(className := "col-sm-8",
          LabAppendViewCp(serverFiles = props.sampleInfo.lab.files,
            id = props.sampleInfo.id, show = props.show)

        )
      ),

    )


  }

}
